package com.ming.mingbase.base.ui;

import javax.annotation.Resource;

import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.ming.mingbase.base.exeption.BaseException;
import com.ming.mingbase.base.service.UserService;
import com.ming.mingbase.base.vo.User;
@Controller("userAction")
public class UserAction {
	@Resource(name="userService")
	private UserService userService;
	
	@RequestMapping("/getUserById")
	@Cacheable(value="common",key="'id_'+#id")  
	@ResponseBody
	public User getUserById(String id){
		User user=null;
		try {
			user=userService.getUserById(id);
		} catch (BaseException e) {
			e.printStackTrace();
		}
		return user;
	}
}
